<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/rp/common/taglib.jsp" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <base href="<%=basePath%>">
    
    <title></title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
	
	<script src="rp/scripts/boot.js" type="text/javascript"></script>
	
	<style type="text/css">
	   	.mini-textbox {width: 180px;}
    </style>
	
  </head>
  
  <body class="body-p5">
  	
    <form id="dataDicTypeForm" method="post">
		<table>
			<tr>
	  			<td>编号：</td>
	  			<td><input class="mini-textbox" name="bh"
	  				required="true" emptyText="请输入类型编号" /></td>
	  		</tr>
	  		<tr>
	  			<td>名称：</td>
	  			<td><input class="mini-textbox" name="text"
	  				required="true" emptyText="请输入名称" /></td>
	  		</tr>
	  		
	  		<tr>
	  			<td></td>
	  			<td><a class="mini-button" onclick="submitForm()"><i class="fa fa-floppy-o fa-lg"></i> 保存</a></td>
	  		</tr>
	  	</table>
	</form>
  	
  	<script type="text/javascript">
		var form;
  		
  		$(function(){
  			
  			form = new mini.Form("dataDicTypeForm");
  		});
  	
  		function submitForm() {
			form.validate();
			if (form.isValid() == false)
				return;

			var data = form.getData();
			var json = rp_encode(data);
			rp_ajax("rp/system/dataDicMng/addDataDicType", {
				data : json
			}, function(result) {
				if (result == "success") {
					closeWindow("ok");
				}
			});
		}
  		
  		/**
		 * 传入参数："ok","cancel"
		 */
		function closeWindow(action) {
			if (window.CloseOwnerWindow)
				return window.CloseOwnerWindow(action);
			else
				window.close();
		}
	</script>
  </body>
</html>